﻿#pragma once

#include <learn/ais/ais_object.h>
#include <learn/alg/alg_sampler.h>
#include <learn/geom/geom_curve.h>

namespace xi
{

namespace ais
{

class EXT_SYMBOL AIS_Curve : public AIS_Object
{
  public:
    AIS_Curve(AIS_Curve &&) = delete;

    /**
     * @brief 指针构造
     *
     * @param[in] curve
     */
    explicit AIS_Curve(std::shared_ptr<Geom_Curve<3>> curve);

    /**
     * @brief 获得曲线
     *
     * @return std::shared_ptr<Geom_Curve<3>>
     */
    std::shared_ptr<Geom_Curve<3>> curve() const;

    /**
     * @brief 曲线采样
     *
     * @param[in] num
     * @return std::vector<Vec3f>
     */
    virtual std::vector<Vec3f> sample(std::size_t num) const;

    /**
     * @brief 初始化消息
     *
     * @param[in] msg
     */
    void visit(AIS_InitMsg *msg) override;

  protected:
    std::shared_ptr<Geom_Curve<3>> m_curve;
    std::shared_ptr<alg::Alg_Sampler> m_sampler;
};

} // namespace ais

} // namespace xi
